import service from "../utils/request";

//轮播图
export function banner_list( payload = {} ){
    return service({
        url:'/banner/list',
        method:'get',
        params: payload
    })
}
//首页快捷分类
export function index_catelist( payload = {} ){
    return service({
        url:'/index/catelist',
        method:'get',
        params: payload
    })
}
//秒杀列表
export function pro_seckilllist( payload = {} ){
    return service({
        url:'/pro/seckilllist',
        method:'get',
        params: payload
    })
}
// 推荐产品列表
export function pro_recommendlist( payload = {} ){
    return service({
        url:'/pro/recommendlist',
        method:'get',
        params: payload
    })
}
// 产品的分类列表

export function pro_categorylist( payload = {} ){
    return service({
        url:'/pro/categorylist',
        method:'get',
        params: payload
    })
}
// 产品分类下品牌列表
export function pro_categorybrandlist( payload = {} ){
    return service({
        url:'/pro/categorybrandlist',
        method:'get',
        params: payload
    })
}
//登录
export function user_login( payload = {} ){
    return service({
        url:'/user/login',
        method:'post',
        data: payload
    })
}
//商品详情
export function pro_detail( payload = {} ){
    return service({
        url:'/pro/detail/'+payload.id,
        method:'get',
        params: payload
    })
}
//加入购物车
export function cart_add( payload = {} ){
    return service({
        url:'/cart/add',
        method:'post',
        data: payload
    })
}
//查看购物车
export function cart_list( payload = {} ){
    return service({
        url:'/cart/list',
        method:'post',
        data: payload
    })
}
//获取用户信息
export function user_info( payload = {} ){
    return service({
        url:'/user/info',
        method:'get',
        params: payload
    })
}
// 清空购物车
export function cart_removeall( payload = {} ){
    return service({
        url:'/cart/removeall',
        method:'post',
        data: payload
    })
}
// 更新购物车数量
export function cart_updatenum( payload = {} ){
    return service({
        url:'/cart/updatenum',
        method:'post',
        data: payload
    })
}
//删除购物车单条数据
export function cart_remove( payload = {} ){
    return service({
        url:'/cart/remove',
        method:'post',
        data: payload
    })
}
// 获取城市列表
export function city_sortCity( payload = {} ){
    return service({
        url:'/city/sortCity',
        method:'get',
        params: payload
    })
}
// 验证手机号码是否被注册过
export function user_docheckphone( payload = {} ){
    return service({
        url:'/user/docheckphone',
        method:'post',
        data: payload
    })
}
// 发送短信验证码
export function user_dosendmsgcode( payload = {} ){
    return service({
        url:'/user/dosendmsgcode',
        method:'post',
        data: payload
    })
}
// 验证短信验证码
export function user_docheckcode( payload = {} ){
    return service({
        url:'/user/docheckcode',
        method:'post',
        data: payload
    })
}
//注册
export function user_dofinishregister( payload = {} ){
    return service({
        url:'/user/dofinishregister',
        method:'post',
        data: payload
    })
}
//更新商品选中状态
export function cart_selectone( payload = {} ){
    return service({
        url:'/cart/selectone',
        method:'post',
        data: payload
    })
}
// 更新所有状态
export function cart_selectall( payload = {} ){
    return service({
        url:'/cart/selectall',
        method:'post',
        data: payload
    })
}